草庐IT

使用grep命令提取指定基因信息

准备基因名称信息基因名称编写脚本catgene.txt|whilereadiddogrep${id}pb_pav.tsv>>gene_pav.txtdone没有得到结果文件,使用cat-v命令查看文件格式,发现结尾有^M的标记编码问题dos2unix是将Windows格式文件转换为Unix、Linux格式的实用命令。Windows格式文件的换行符为\r\n,而Unix&Linux文件的换行符为\n.dos2unix命令其实就是将文件中的\r\n转换为\n。而unix2dos则是和dos2unix互为孪生的一个命令,它是将Linux&Unix格式文件转换为Windows格式文件的命令。感谢梁同学

关于bash:使用awk/sed/grep从文件中的匹配模式中删除上下多行

Deletemultiplelinesaboveandbelowfromamatchingpatterninafileusingawk/sed/grep我有file.txt包含:123456789101112131415161718192021222324252627282930313233343536373839registered{  hostname-1  {    AAA32;    BBBuuid-1;    ip192.168.1.1;    hosthostname-1;    ...    ...    ...  }}registered{  hostname-2  {    

关于bash:使用awk/sed/grep从文件中的匹配模式中删除上下多行

Deletemultiplelinesaboveandbelowfromamatchingpatterninafileusingawk/sed/grep我有file.txt包含:123456789101112131415161718192021222324252627282930313233343536373839registered{  hostname-1  {    AAA32;    BBBuuid-1;    ip192.168.1.1;    hosthostname-1;    ...    ...    ...  }}registered{  hostname-2  {